﻿<!-- Phan khai bao bien cuc bo-->
<?php
//echo "helooo";
$v_record_id = 0;
if(isset($_REQUEST['hdn_record_id'])){
	$v_record_id = intval($_REQUEST['hdn_record_id']);
}
if ($v_record_work_id >0) {
	$v_record_work_id = $arr_single_record_work['PK_RECORD_WORK'];
	$v_record_id = $arr_single_record_work['FK_RECORD'];
	$v_worker = $arr_single_record_work['FK_WORKER'];
	$v_record_work_worktype = _replace_bad_char($arr_single_record_work['C_WORKTYPE']);
	$v_date = _yyyymmdd_to_ddmmyyyy($arr_single_record_work['C_DATE']); 
	$v_result = $arr_single_record_work['C_RESULT']; 
	$v_file_name = $arr_single_record_work['C_FILE_NAME'];
	$v_system_worktype = $arr_single_record_work['C_SYSTEM_WORKTYPE'];
	$v_readonly = "readonly";
}else{
	$v_record_work_id = 0;
	$v_date = date('d/m/Y');
	$v_result = "";
	$v_readonly = "";
}
$v_display = "none";
if ($v_count_worktype > 0){
	$v_display = "block";
}
$v_hight_list = "120px";
if ($v_record_work_id>0){
	$v_hight_list = "25px";
}

$v_file_url = trim(CONST_URL_PATH_FROM_ROOT) . $v_file_name;
//echo $v_file_name;
$v_goto_url = "javascript:filename_onclick('T_ONEGATE_RECORD_WORK', 'PK_RECORD_WORK', 'C_FILE_NAME', 'C_FILE_CONTENT'," . strval($v_record_work_id) . ",'" . $v_file_url ."');" ;
?>
<!--bang chua tieu de cua form-->
<table width="100%" cellpadding="0" cellspacing="0">
	<tr class="large_title">
		<td><?php echo CONST_RECORD_WORK_UPDATE_TITLE; ?></td>
	</tr>
</table>
<!-- Bat cac phim: F12=true; Insert=false; Delete=false, ESC=true; Enter=true -->
<div id="hotkey" onKeyDown="javascript:process_hot_key(true,false,false,true,true);">
<!--bang chua cac text box de nhap du lieu-->
<table width="100%" class="form_table1" border="0" cellpadding="0" cellspacing="0">
	<col width="18%"><col width="32%"><col width="31%"><col width="19%">
	<tr>
		<form action="index.php" method="post" name="f_dsp_single_record_work" enctype= "multipart/form-data">
		<input type="hidden" name="fuseaction" value="UPDATE_RECORD_WORK" >
		<input type="hidden" name="hdn_record_work_id" value="<?php echo $v_record_work_id;?>" >
		<input type="hidden" name="hdn_record_id"  value="<?php echo $v_record_id; ?>">
		<input type="hidden" name="hdn_recordtype_filter" value="<?php echo $v_recordtype_filter; ?>">
		<input type="hidden" name="hdn_work" value="<?php echo $v_record_work_worktype;?>">
	</tr>
	<tr>
		<td colspan="10"><?php echo onegate_show_record_general_info($arr_single_record,$_SESSION['recordtype'],$v_show_link,$p_petition_link,$p_rate_of_progress_link,$p_document_link,$p_idea_link,$p_sign_link,$p_approve_link,$p_licensing_link,$v_url_view_update_record_status); ?></td>
	</tr>
	<tr>
		<td colspan="6"><hr color="#66CCFF" width="100%" size="1"></td>
	</tr>
	<tr>
		<td align="left" class="normal_label"><?php echo CONST_RECORD_REALIZE_DATE_LABEL.":";?><small class="normal_starmark">*</small></td>
		<td colspan="2">
			<input type="text" name="txt_date" <?php echo $v_readonly;?> class="normal_date_textbox" isdate = "true" optional="<?php echo CONST_DATE_OPTIONAL; ?>" message = "<?php echo CONST_DATE_MESSAGE; ?>" value="<?php echo $v_date; ?>" onKeyDown="change_focus(document.forms(0),this);"><?php
			if ($v_record_work_id <= 0){?>
			<img src="<? echo $_ISA_IMAGE_URL_PATH;?>calendar.gif" border="0" onclick="DoCal('<?php echo $_ISA_LIB_URL_PATH; ?>isa-calendar/',document.forms(0).txt_date);" style="cursor:hand;"><?php
			}?>
		</td>		
	</tr>
	<tr style="display:<?php echo $v_display;?>">
		<td class="normal_label" valign="top"><?php echo CONST_RECORD_WORKTYPE_LABEL;?><small class="normal_starmark">*</small></td>
		<td colspan="10" align="left">
			<DIV STYLE="overflow: auto; height:<?php echo $v_hight_list;?>; padding-left:0px;margin:0px">
				<table class="list_table2"  width="100%" cellpadding="0" cellspacing="0">
					<col width="5%"><col width="95%"><?php
						for ($i=0;$i<$v_count_recordwork_by_recordtype;$i++) {
							$v_worktype_id = $arr_all_recordwork_by_recordtype[$i]['PK_WORKTYPE'];
							$v_worktype_name = _replace_bad_char($arr_all_recordwork_by_recordtype[$i]['C_NAME']);
							if ($v_current_style_name == "odd_row"){
								$v_current_style_name = "round_row";
							}else{
								$v_current_style_name = "odd_row";
							}
							$v_checked = "";
							$v_disable = "";
							if ($v_worktype_id == $v_record_work_worktype ){
								$v_checked = "checked";
							}
							if ($v_record_work_id>0){
								if ($v_worktype_id == $v_record_work_worktype){
								$v_disable = "   ";?>
								<tr class="<?php echo $v_current_style_name;?>">
									<td ><input type="radio" name="opt_worktype_id" readonly="true" message = "<?php echo CONST_WORKTYPE_MESSAGE; ?>" value="<?php echo $v_worktype_id;?>" <?php echo $v_disable;?> <?php echo $v_checked;?> onClick="document.forms(0).hdn_work.value = this.value ; document.getElementById('worktype').innerHTML=document.forms(0).<?php echo $v_worktype_id;?>.value;"></td>
									<td colspan="10"><?php echo $v_worktype_name;?></td>
									<td><input type="hidden" name="<?php echo $v_worktype_id;?>" value="<?php echo $v_worktype_name;?>"></td>
								</tr><?php
								}
							}else{							
								if (trim($arr_all_recordwork_by_recordtype[$i]['C_OCCURING_TIME']) == "THU_LY" || trim($arr_all_recordwork_by_recordtype[$i]['C_OCCURING_TIME']) == "TOAN_BO"){?>
								<tr class="<?php echo $v_current_style_name;?>">
									<td ><input type="radio" name="opt_worktype_id" message = "<?php echo CONST_WORKTYPE_MESSAGE; ?>" value="<?php echo $v_worktype_id;?>" <?php echo $v_readonly;?> <?php echo $v_checked;?> onClick="document.forms(0).hdn_work.value = this.value ; document.getElementById('worktype').innerHTML=document.forms(0).<?php echo $v_worktype_id;?>.value;"></td>
									<td colspan="10"><?php echo $v_worktype_name;?></td>
									<td><input type="hidden" name="<?php echo $v_worktype_id;?>" value="<?php echo $v_worktype_name;?>"></td>
								</tr><?php
								}
							}
						}?>
				</table>
			</DIV>
		</td>
	</tr>








	<tr style="display:<?php echo $v_display;?>">
		<td class="normal_label" valign="top" colspan="10"><?php echo CONST_ATTACH_FILE_WORKTYPE;?><font color="#000000" size="2"><u><span id="worktype"></span></u></td>
	</tr>
	<tr style="display:<?php echo $v_display;?>">	
		<td>&nbsp;</td>	
		<td colspan="10" align="left">
		<DIV STYLE="overflow: auto; height:<?php echo '100px';?>; padding-left:0px;margin:0px">
			<span id="txtHint"></span>
		</DIV>	
		</td>
	</tr>
	<tr>
		<td class="normal_label"><?php echo CONST_RECORD_RESULT_LABEL;?><small class="normal_starmark">*</small></td>
		<td colspan="5" ><textarea  <?php echo $v_readonly;?> name="txt_result" style="width:99% " class="normal_textarea" value="" rows="3" message="<?php echo CONST_RESULT_MESSAGE; ?>" optional="<?php echo CONST_RESULT_OPTIONAL; ?>"><?php echo  _replace_bad_char($v_result); ?></textarea></td>
	</tr><?php
	if (($v_record_work_id > 0)&&($v_file_name <> '')){?>
	<tr>
		<td class="normal_label"><?php echo CONST_ATTACH_FILE_LABEL; ?></td>
		<td class="normal_label" colspan="5" align="left">
			<a href="<? echo $v_goto_url; ?>" class="normal_link"><? echo $v_file_name;?></a>
		</td>
	</tr><?php
	}else if ($v_record_work_id <= 0){?>
	<tr>
		<td class="normal_label"><?php echo CONST_ATTACH_FILE_LABEL; ?></td>
		<td colspan="5">
			<input type="file" name="file_attach" style="width:100%" class="small_textbox" message="<?php echo CONST_ATTACH_FILE_MESSAGE;?>" onKeyDown="change_focus(document.forms(0),this)">
		</td>
	</tr><?php
	}?>
</table>
<!--bang chua cac button-->
<table width="100%" >
	<tr>
		<td align="center" width="100%" height="40" valign="bottom"><?php
			if ($v_record_work_id <=0){?>
			<input type="button" name="btn_save"  class="normal_button" value="<?php echo _CONST_SAVE_BUTTON;?>" onClick="btn_save_process_onclick('004','<?php echo date("d/m/Y");?>',document.forms(0).txt_date,document.forms(0).hdn_record_id,'DISPLAY_KYNHAN_RECORD');" onKeyDown="change_focus(document.forms(0),this)"><?php
			}?>
			<input type="button" name="btn_back" class="normal_button" value="<?php echo _CONST_BACK_BUTTON;?>" onClick="btn_back_onclick('<?php echo $_GO_BACK?>')" onKeyDown="change_focus(document.forms(0),this)">
		</td>
	</tr>
</table>					
</div>
</form>
<script language="JavaScript">
	set_focus(document.forms(0));
	window.dialogHeight = "340pt";
	window.dialogWidth = "420pt";
	window.dialogTop = "80pt";
</script>
			<!--
			<input type="button" name="btn_save"  class="normal_button" value="<?php echo _CONST_SAVE_BUTTON;?>" onClick="btn_save_onclick('UPDATE_RECORD_WORK');" onKeyDown="change_focus(document.forms(0),this)">
!-->
